package HP.com.bank_2.wangyu.bean;

import HP.com.bank_2.wangyu.dao.BankDao;
import HP.com.bank_2.wangyu.view.UserUI;

public class ATM {

    public ATM() {

    }

    public void openATM(User user) {
        //user.setCardPwd();
        // user.setCardPwd();

    }

    public void welcome() {
        //UserUI.mainUI();
        UserUI.printUI(0);
        UserUI.printUI(3);
        UserUI.printUI(1);
        System.out.println("请输入1--3进行选择:");
    }

    public void userSelect(int select, User user) {
        if (select == 1) {
            userLogin(user);
        } else if (select == 2) {

        } else if (select == 3) {

        } else if (select == 4) {

        }

    }

    public void userLogin(User user) {
        UserUI.printUI(0);
        System.out.println("当前位置-->登录\n请输入卡号和密码进行登录.\n");
        System.out.println("卡号:");
        int userInPutId = user.inPutNum();
        System.out.println("密码:");
        int userInPutPwd = user.inPutNum();
        //Object userInfo = bankDao.selectUserAll(userInPutId);
        //int userTruePwd = userInfo[1];
        user.setCardId(userInPutId);
        new BankDao().setUser(user);
        System.out.println(user);

    }
}
